package com.agui.exceptionDemo.controller;


import com.agui.exceptionDemo.service.EDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {
    @Autowired
    EDemoService eDemoService;

    @RequestMapping("/test")
    public String indexTest(@RequestParam Integer a, @RequestParam Integer b) {
        System.out.println("ceshi----->>");
        try {
           return eDemoService.getMain(a,b);
        } catch (Exception e) {
            System.out.println("00000");
            System.out.println(e.getMessage());
            return e.getMessage();
        } finally {
            System.out.println("indexTest-->.ok");
        }
    }
}
